commands/extcmd: Missing check for failed allocation
authorLidong Chen <lidong.chen@oracle.com>
Fri, 22 Nov 2024 06:27:55 +0000 (06:27 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit4ccb621c7d343694d5c3bf2e5a59983923296322
tree985642975587162047360934e488afbdfcdb542e
parent6f7dab441a49df133609a597a9422897c0bc40cd
commands/extcmd: Missing check for failed allocation

The grub_extcmd_dispatcher() calls grub_arg_list_alloc() to allocate
a grub_arg_list struct but it does not verify the allocation was successful.
In case of failed allocation the NULL state pointer can be accessed in
parse_option() through grub_arg_parse() which may lead to a security issue.

Fixes: CVE-2024-45775
Reported-by: Nils Langius <nils@langius.de>
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name commands-extcmd-Missing-check-for-failed-allocation.patch
grub-core/commands/extcmd.c